package com.ccrfid.rmc6.service.business.nightpatrol;

import com.ccrfid.rmc6.appconfig.exception.pojo.AppException;
import com.ccrfid.rmc6.entity.business.nightpatrol.*;
import com.ccrfid.rmc6.pojo.param.PageParam;
import com.ccrfid.rmc6.repository.search.SearchCriteria;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.Date;
import java.util.List;

public interface NightPatrolService {

    //获取全部巡更组
    List<NpGroupEntity> getAllPcGroups();

    //获取巡更组下属成员
    List<NpGroupMemberEntity> getAllGroupMembersByGroupId(Long groupId);

    //新增一个巡更组
    Long createNpGroup(NpGroupEntity npGroupEntity) throws AppException;

    //添加巡更组成员
    Boolean createNpGroupMemberInfo(NpGroupMemberEntity npGroupMemberEntity, Long groupId) throws AppException;

    //分页获取巡更组信息
    Page<NpGroupViewEntity> getNpGroupView(SearchCriteria criteria, Pageable pageable);

    Page<NpGroupViewEntity> getRcRecordList(String groupName, String personnelName, String patrolPlace, String patrolTime,
                                            PageParam pageParam, Pageable pageable);

    //删除某个巡更组
    Boolean deleteNpGroup(Long groupId) throws AppException;

    //更新巡更组信息
    Boolean updateNpGroupInfo(Long groupId, NpGroupEntity npGroupEntity) throws AppException;

    //删除巡更组员信息
    Boolean deleteNpGroupMembers(Long groupId, Long memberId) throws AppException;

    //分页查询巡更记录信息
    Page<NpResultEntity> getNpResultInfo(String startPatrolPlace, String patrolTime, String groupName,
                                         PageParam pageParam, Pageable pageable);

    //获取巡更记录详细信息
    List<NpResultDetailEntity> getMpResultDetail(Long resultId) throws AppException;

    //保存巡更记录
    void saveNpResultInfo(Long groupId, Date startTime, Date stopTime) throws AppException;

//    //查询记录实时获取巡更信息
//    void saveNpResultinfoForQuery(String groupName, String patrolTime)throws AppException;

    //分页获取巡更组信息
    Page<NpResultDetailEntity> getNpResultDetail(SearchCriteria criteria, Pageable pageable);

    //分页获取巡更组信息
    Page<NpResultDetailEntity> getNpResultDetailInfo(Long resultId, String personnelName, int type,
                                                     Long timeLength, PageParam pageParam, Pageable pageable);


}
